#ifndef __CAMERA_COM_H
#define __CAMERA_COM_H

#include "typedefs.h"
#include "usart.h"
#include "fruit_center.h"

typedef enum{
	CT_COLOR_NONE = 0,
	CT_RED = 0x01,
	CT_GREEN = 0x02,
	CT_YELLOW = 0x04,
	CT_COLOR_MAX
}ct_color_t;

typedef enum{
	CT_SHAPE_NONE,
	CT_SHAPE_SPHERE,
	CT_SHAPE_SQUARE,
	CT_SHAPE_TRIANGLE,
	CT_SHAPE_STAR,
	CT_SHAPE_MAX
}ct_shape_t;

typedef enum{
	camera_find_fruit = CAMERA_EVENT_START_ADDR,
	camera_nofind_fruit,
	camera_readed_pos,
}camera_event_t;

typedef struct{
	object_pos_t pos;
	ct_color_t color;
	ct_shape_t shape;
}obj_info_t;

void CameraCom_Control(FunctionalState state);
void CameraCom_ReadObjectInfo(obj_info_t* info);
void CameraCom_SetShift(uint16_t shiftx,uint16_t shifty);
void CameraCom_GetShift(uint16_t* shiftx,uint16_t* shifty);
bool CameraCom_Check(void);
#endif
